package com.topone.service.impl;

import com.topone.dataObject.CouponCategory;
import com.topone.repository.CouponCategoryRepository;
import com.topone.repository.TcUserCouponRepository;
import com.topone.service.CouponCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/12/6,0006.
 */
@Service
public class CouponCategoryServiceImpl implements CouponCategoryService {
    @Autowired
    private CouponCategoryRepository repository;

    //查询单个券种类
    @Override
    public CouponCategory findOne(Integer categoryId) {
        return repository.findOne(categoryId);
    }
    //查询所有券种类
    @Override
    public List<CouponCategory> findAll() {
        return repository.findAll();
    }

    //根据券类型插叙所有券种类
    @Override
    public List<CouponCategory> findByCouponTypeIn(List<Integer> couponTypeList) {
        return repository.findByCouponTypeIn(couponTypeList);
    }

    //保存或者更新券种类
    @Override
    public CouponCategory save(CouponCategory couponCategory) {
        return repository.save(couponCategory);
    }
}
